/*
 * @Author: hanxin 
 * @Date: 2021-08-11 21:25:52 
 * @Last Modified by: hanxin
 * @Last Modified time: 2021-08-13 22:17:00
 * 客户端线程管理类 
 */
package service;

import java.util.Hashtable;

public class manageClienToServerThread {
   //用户id作为key是可行的. 一个用户id可以有多个socket,key相同值不相同是可以放入hash表的
    private static Hashtable<String, clientConnectServerThread> hashtable = new Hashtable<>();

    /**
     * 将客户端线程添加到哈希表
     * 
     * @param uid
     * @param thread
     */
    public static void Threadjoin(String uid, clientConnectServerThread thread) {
        hashtable.put(uid, thread);
    }
    /**
     * 返回当前客户端socket线程
     * @param uid
     * @return
     */
    public static clientConnectServerThread returnThread(String uid) {
        return hashtable.get(uid);
    }
    public static void removeThread(String uid) {
        hashtable.remove(uid);
    }
}
